package com.edu.nf.implement;

import com.edu.nf.handle.RowProcessor;
import com.edu.nf.interfaces.ResultSetHandler;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Map;

public class MapHandler implements ResultSetHandler<Map<String,Object>> {
    @Override
    public Map<String, Object> handle(ResultSet rs) throws SQLException {
        return rs.next()? RowProcessor.toMap(rs):null;
    }
}
